#ifndef _COMMUNICATION_DEVICE_ELECTRICAL_HEAD
#define _COMMUNICATION_DEVICE_ELECTRICAL_HEAD
#include "communication-device.h"
#include "smart-device-manager.h"
#include <map>
#include "smart-device-database.h"
/**
 * 门锁社保类
*/
class CommunicationDeviceElectrical : public CommunicationDevice
{
public:
	CommunicationDeviceElectrical(SmartDeviceManager *manager);
	void communication(SmartDevicenetProtocol &netProtocol, NetCommunication *netObj);
	void add(SmartDevicenetProtocol &netProtocol, NetCommunication *netObj);
	void remove(SmartDevicenetProtocol &netProtocol, NetCommunication *netObj);
	void open(SmartDevicenetProtocol &netProtocol, NetCommunication *netObj);
	void close(SmartDevicenetProtocol &netProtocol, NetCommunication *netObj);
	void query(SmartDevicenetProtocol &netProtocol, NetCommunication *netObj);
	void replay(NetCommunication *netObj, const string &command, const string &errmsg = "", const string &data = "");

private:
	SmartDeviceManager *smartDeviceManager;
	typedef void (CommunicationDeviceElectrical::*funcation_t)(SmartDevicenetProtocol &, NetCommunication *);
	map<string, funcation_t> handle;
};

#endif